﻿using HotelManager.Models;
using HotelManager.Models.Params;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HotelManager.Service
{
    public class LoginService:ILoginService
    {
        private readonly HttpRestClient client;
        private readonly string serviceName = "Login";
        public LoginService(HttpRestClient client) 
        {
            this.client = client;
        }
        public async Task<ResultData<UserData>> LoginAsync(LoginParam loginParam)
        {
            BaseRequest request = new BaseRequest();
            request.Method = RestSharp.Method.Get;
            request.Route = $"api/Admin/Login?loginId={loginParam.loginId}"+$"&loginPwd={loginParam.loginPwd}";
            return await client.ExecuteAsync<ResultData<UserData>>(request);
        }
    }
}
